package com.geekmvc.controller;

import com.geekmvc.entity.Coffee;
import com.geekmvc.service.CoffeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
@RequestMapping("/coffee/xml")
public class CoffeeXmlController {
    @Autowired
    private CoffeeService coffeeService;

    @GetMapping(path = "/", params = "!name",
            produces = MediaType.APPLICATION_XML_VALUE)
    @ResponseBody
    public List<Coffee> getAll() {
        return coffeeService.getAllCoffee();
    }


}
